#coding=utf-8
from bottle import BaseTemplate, jinja2_template, request
from config import config
 
BaseTemplate.defaults.update(dict(
	request=request,
	config=config,
	)
)

def tpl(file, **args):
	return jinja2_template(file, args)
	# return template(file, args)

def tplfilter(name):
	def decorator(func):
		BaseTemplate.defaults.setdefault(name, func)
		return func
	return decorator